package com.wu.ssm.aspect;

import com.wu.ssm.controller.SpringmvcController;
import com.wu.ssm.spring.ioc.ApplicationContextAOP;

import java.util.concurrent.ConcurrentHashMap;

/**
 * Created by wzf on 2018/11/27/027.
 */
public class Test {

    public void doSomeThing() {
        System.out.println("do some thing...");
    }

    public void doWtihNotProxy() {
        System.out.println("do some thing with not proxy");
    }

    public static void main(String[] args) {
        // 模拟容器初始化
        ApplicationContextAOP applicationContext = new ApplicationContextAOP();
        ConcurrentHashMap<String, Object> proxyBeanMap = ApplicationContextAOP.proxyBeanMap;

        // 生成的代理对象 默认为该类名的小写
        Test test = (Test) proxyBeanMap.get("test");
        test.doSomeThing();

        System.out.println("-------------");

        test.doWtihNotProxy();

        SpringmvcController springmvcController = (SpringmvcController) proxyBeanMap.get("springmvccontroller");
        springmvcController.insert1();
    }
}
